package day6;

import java.util.Scanner;

public class Marketest {
    public static void main(String[] args) {
        Market a = new Market();
        Scanner in = new Scanner(System.in);
        while (true) {
            System.out.println("1.添加会员；2.显示会员信息；3.增加会员积分；4.积分兑换；0.退出。请选择：");
            int chosen1 = in.nextInt();
            switch (chosen1) {
                case 1: {
                    System.out.println("请选择会员卡号：");
                    String cardNo=in.next();
                    System.out.println("请输入姓名：");
                    String name = in.next();
                    System.out.println("请输入联系方式：");
                    String phone = in.next();
                    System.out.println("请输入积分：");
                    int point=in.nextInt();
                    Card b=new Card(cardNo,name,phone,point);
                    a.addinfo(b);
                    break;

                }
                case 2:{
                    System.out.println("会员信息");
                        a.show();
                        break;
                }
                case 3: {

                    System.out.println("请输入会员卡号");
                     String cardNo= in.next();
                    System.out.println("请输入要增加的积分：");
                    int fen = in.nextInt();
                    a.inc(cardNo, fen);
                    break;
                }
                case 4: {
                    System.out.println("请输入会员卡号：");
                    String cardNo = in.next();
                    a.exchange(cardNo);
                    break;
                }
                case 0: {
                    System.out.println("感谢使用！");
                    return;
                }


            }

        }
    }
}